package shangji1;

public class Factory {
    public static Operator getOperator(String arg) {
        Operator operator = null;

        if (arg.equals("+")) {
            operator = new Add();
        } else if (arg.equals("-")) {
            operator = new Subtract();
        } else if (arg.equals("*")) {
            operator = new Multiply();
        } else if (arg.equals("/")) {
            operator = new Except();
        }
        return operator;
    }
}
